package com.sdleyou.treepro.common.service.impl;

import com.sdleyou.treepro.common.model.dao.SloganDO;
import com.sdleyou.treepro.common.model.vo.SloganVO;
import com.sdleyou.treepro.common.service.SloganManager;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

@Service
public class SloganManagerImpl implements SloganManager {
    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public void createSlogan(SloganVO sloganVO) {
        SloganDO sloganDO = new SloganDO();
        BeanUtils.copyProperties(sloganVO, sloganDO);
        sloganDO.setStatus("SHOW");
        mongoTemplate.insert(sloganDO);
        return;
    }
}
